///云认养记录
import { ADOPTION_RECORD_TYPE } from '@/const/type';
///列表
export const tableOption = (type) => {
  return {
    ...window.$crudMixins.tableOptions,
    addBtn: false,
    editBtn: false,
    delBtn: false,
    menuWidth: 150,
    viewBtn: false,
    column: [
      {
        label: '宠物ID',
        prop: 'petId',
        slot: true,
      },
      {
        label: '宠物昵称',
        prop: 'petName',
        search: true,
      },
      {
        label: '所属区域',
        prop: 'petArea',
      },
      {
        label: '品种',
        prop: 'petVariety',
      },
      {
        label: '性别',
        prop: 'petGender',
      },
      {
        label: '认养人',
        prop: 'userName',
        slot: true,
        search: true,
        width: 150,
      },
      {
        label: '负责人',
        prop: 'director',
        search: true,
      },
      {
        label: '云养开始时间',
        prop: 'startTime',
        width: 120,
      },
      {
        label: '云养到期时间',
        prop: 'endTime',
        hide: type === ADOPTION_RECORD_TYPE.STOP,
        width: 120,
      },
      {
        label: '云养停止时间',
        prop: 'stopTime',
        hide: type !== ADOPTION_RECORD_TYPE.STOP,
        width: 120,
      },
      // {
      //   label: '备注',
      //   prop: 'remark',
      //   hide: type !== ADOPTION_RECORD_TYPE.EXPIRED,
      // },
      {
        label: '订单停止原因',
        prop: 'stopReason',
        hide: type !== ADOPTION_RECORD_TYPE.STOP,
        width: 120,
      },
    ],
  };
};
// 制定负责人
export const directorFormOption = {
  labelWidth: 150,
  submitBtn: false,
  emptyBtn: false,
  column: [
    {
      label: '宠物昵称',
      prop: 'petName',
      detail: true,
    },
    {
      label: '宠物编号',
      prop: 'petId',
      detail: true,
    },
    {
      label: '所属区域',
      prop: 'petArea',
      detail: true,
    },
    {
      label: '猫咪日记负责人',
      type: 'select',
      filterable: true,
      prop: 'userIds',
      row: true,
      span: 24,
      placeholder: '请选择负责人，支持多选',
      multiple: true,
      formsolt: true,
      rules: [
        {
          required: true,
          message: '请选择负责人',
          trigger: 'blur',
        },
      ],
      // dicUrl: '/admin/user/list',
      // props: {
      //   label: 'username',
      //   value: 'userId',
      // },
    },
  ],
};

//变更记录
export const changeLogOption = {
  ...window.$crudMixins.tableOptions,
  addBtn: false,
  editBtn: false,
  delBtn: false,
  viewBtn: false,
  menu: false,
  column: [
    {
      label: '修改时间',
      prop: 'createTime',
    },
    {
      label: '变更前',
      prop: 'oldNames',
    },
    {
      label: '变更后',
      prop: 'userNames',
    },
    {
      label: '修改人',
      prop: 'createBy',
    },
  ],
};
